package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.admin.vo.HeaderFieldsVO;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.EmpSocInfoAddDTO;
import org.jsola.hr.dto.EmpSocInfoUpdateDTO;
import org.jsola.hr.dto.EmpSocItemListBatchDTO;
import org.jsola.hr.query.EmpSocInfoQuery;
import org.jsola.hr.query.HeaderFieldsSocQuery;
import org.jsola.hr.vo.*;
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.Valid;
import java.util.Date;
import java.util.List;

/**
 * 员工参保信息表
 *
 * @author zhr
 */
@Api(tags = "hr-员工参保信息表")
public interface IEmpSocInfoControllerAPI {

    /**
     * 修改员工参保信息表
     *
     * @param empSocInfoUpdateDTO 员工参保信息表
     * @return 更新数量
     */
    @ApiOperation(value = "修改员工参保信息表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocInfoUpdateDTO", dataType = "EmpSocInfoUpdateDTO", value = "修改员工参保信息表", paramType = "body")
    })
    Result<Integer> update(EmpSocInfoUpdateDTO empSocInfoUpdateDTO);


    /**
     * 删除单个员工参保信息表，彻底删除
     *
     * @param empSocInfoId 员工参保信息表id
     * @return 删除数量
     */
    @ApiOperation(value = "删除单个员工参保信息表，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocInfoId", dataType = "String", value = "员工参保信息表id", paramType = "path")
    })
    Result<Integer> delete(String empSocInfoId);


    /**
     * 批量删除员工参保信息表，彻底删除
     *
     * @param empSocInfoIds 员工参保信息表id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除员工参保信息表，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocInfoIds", dataType = "String[]", value = "员工参保信息表id数组", paramType = "body", allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] empSocInfoIds);


    /**
     * 根据员工参保信息表id查询员工参保信息表详情
     *
     * @param empSocInfoId 员工参保信息表id
     * @return 员工参保信息表详情
     */
    @ApiOperation(value = "根据员工参保信息表id查询员工参保信息表详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocInfoId", dataType = "String", value = "员工参保信息表id", paramType = "path")
    })
    Result<EmpSocInfoVO> findById(String empSocInfoId);


    /**
     * 查询员工参保信息表
     *
     * @param empSocInfoQuery 员工参保信息表查询参数
     * @return page
     */
    @ApiOperation(value = "查询员工参保信息表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocInfoQuery", dataType = "EmpSocInfoQuery", value = "员工参保信息表查询参数", paramType = "query")
    })
    Result<List<EmpSocInfoListVO>> listAll(EmpSocInfoQuery empSocInfoQuery);


    /**
     * 分页查询员工参保信息表
     *
     * @param empSocInfoQuery 员工参保信息表查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询员工参保信息表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocInfoQuery", dataType = "EmpSocInfoQuery", value = "员工参保信息表查询参数", paramType = "query")
    })
    Result<Page<EmpSocInfoListVO>> page(EmpSocInfoQuery empSocInfoQuery);


    /**
     * 查询员工参保月账单列表
     *
     * @param empSocInfoQuery 员工参保信息表查询参数
     * @return 员工参保月账单列表
     */
    @ApiOperation(value = "查询员工参保月账单列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocInfoQuery", dataType = "EmpSocInfoQuery", value = "员工参保信息表查询参数", paramType = "query")
    })
    Result<List<EmpSocInfoListVO>> getEmpSocInfoMonthList(EmpSocInfoQuery empSocInfoQuery);

    /**
     * 花名册查询社保
     *
     * @param empId     员工Id
     * @param companyId 公司Id
     * @return 社保详情
     */
    @ApiOperation(value = "花名册查询社保")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empId", dataType = "String", value = "员工Id", paramType = "query"),
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司Id", paramType = "query")
    })
    Result<EmpSocInfoVO> getEmpSocInfoWithEmpInfo(String empId, String companyId);


    /**
     * 新增员工参保次月账单
     *
     * @return 员工参保操作返回信息
     */
    @ApiOperation(value = "新增员工参保次月账单")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocInfoQuery", dataType = "EmpSocInfoQuery", value = "新增员工参保次月账单", paramType = "body")
    })
    Result<String> saveEmpSocInfoNextMonth(EmpSocInfoQuery empSocInfoQuery);


    /**
     * 分页查询员工参保信息
     *
     * @param empSocInfoQuery 员工参保信息查询参数
     * @return 员工信息列表
     */
    @ApiOperation(value = "分页查询员工参保信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocInfoQuery", dataType = "EmpSocInfoQuery", value = "查询员工参保信息", paramType = "query")
    })
    Result<Page<EmpSocInfoListVO>> pageEmpSocInfo(EmpSocInfoQuery empSocInfoQuery);

    /**
     * 分页查询员工参保信息(社保回款使用)
     *
     * @param empSocInfoQuery 员工参保信息查询参数
     * @return 员工信息列表
     */
    @ApiOperation(value = "分页查询员工参保信息(社保回款使用)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocInfoQuery", dataType = "EmpSocInfoQuery", value = "查询员工参保信息", paramType = "query")
    })
    Result<Page<EmpSocInfoListVO>> pageEmpSocBack(EmpSocInfoQuery empSocInfoQuery);

    /**
     * 退费
     *
     * @param empSocInfoAddDTO 退费参数
     * @return 退费回显
     */
    @ApiOperation(value = "退费")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocInfoAddDTO", dataType = "EmpSocInfoAddDTO", value = "退费参数", paramType = "body")
    })
    Result<EmpSocInfoVO> refunds(EmpSocInfoAddDTO empSocInfoAddDTO);

    /**
     * 查询员工参保金额统计
     *
     * @param year      年
     * @param month     月
     * @param companyId 公司id
     * @param monthId   月份统计id
     * @return 参保金额数据
     */
    @ApiOperation(value = "员工参保金额统计")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "year", dataType = "String", value = "年份", paramType = "query"),
            @ApiImplicitParam(name = "month", dataType = "String", value = "月份", paramType = "query"),
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司id", paramType = "query"),
            @ApiImplicitParam(name = "monthId", dataType = "String", value = "月账单id", paramType = "query")
    })
    Result<EmpSocInfoListVO> getAmount(String year, String month, String companyId, String monthId);

    /**
     * 分页查询新增员工参保信息
     *
     * @param empSocInfoQuery 员工参保信息查询参数
     * @return 员工信息列表
     */
    @ApiOperation(value = "分页查询新增员工参保信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocInfoQuery", dataType = "EmpSocInfoQuery", value = "查询员工参保信息", paramType = "query")
    })
    Result<Page<EmpSocInfoListVO>> pageAddEmpSocInfo(EmpSocInfoQuery empSocInfoQuery);

    /**
     * 按照参保方案编辑
     *
     * @return 返回执行状态
     */
    @ApiOperation(value = "按照参保方案编辑")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocItemListBatchDTO", dataType = "EmpSocItemListBatchDTO", value = "员工参保信息子表", paramType = "body")
    })
    Result<Boolean> setCardinality(@Valid @RequestBody EmpSocItemListBatchDTO empSocItemListBatchDTO);

    /**
     * 按照参保金额编辑
     *
     * @return 返回执行状态
     */
    @ApiOperation(value = "按照参保金额编辑")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocItemListBatchDTO", dataType = "EmpSocItemListBatchDTO", value = "按照参保金额编辑", paramType = "body")
    })
    Result<Boolean> setAmount(@Valid @RequestBody EmpSocItemListBatchDTO empSocItemListBatchDTO);

    /**
     * 员工参保记录
     *
     * @param empSocInfoQuery 员工信息
     * @return 返回员工参保记录数据集合
     */
    @ApiOperation(value = "员工参保记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocInfoQuery", dataType = "EmpSocInfoQuery", value = "查询员工参保信息", paramType = "query")
    })
    Result<Page<EmpSocInfoListVO>> selectEmpSocInfoByEmpId(EmpSocInfoQuery empSocInfoQuery);

    /**
     * 导入批量编辑Excel
     *
     * @param file    excel
     * @param monthId 参保月
     * @return 错误信息
     */
    @ApiOperation(value = "导入批量编辑Excel")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "file",
                    value = "文件，Content-Type需要设置为multipart/form-data",
                    paramType = "form"),
            @ApiImplicitParam(name = "monthId", dataType = "String", value = "参保月id", paramType = "path")

    })
    Result<BulkEditWrongsVO> bulkEditImport(String monthId, MultipartFile file);

    /**
     * 批量编辑导出错误数据
     *
     * @param bulkEditWrongsVO 错误数据
     * @return excel
     */
    @ApiOperation(value = "批量编辑导出错误数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "bulkEditWrongsVO", dataType = "BulkEditWrongsVO", value = "错误数据", paramType = "body")
    })
    ResponseEntity<Resource> exportErrorExcel(@RequestBody BulkEditWrongsVO bulkEditWrongsVO);

    /**
     * 某个员工参保记录所在的年份
     *
     * @param empId     员工id
     * @param companyId 公司id
     * @return 返回员工参保记录数据集合
     */
    @ApiOperation(value = "某个员工参保记录所在的年份")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empId", dataType = "String", value = "员工id", paramType = "query"),
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司id", paramType = "query")
    })
    Result<List<String>> selectYearByEmpId(String empId, String companyId);

    /**
     * 查询某个参保方案使用的月份
     *
     * @param progId 参保方案id
     * @return 返回结果
     */
    @ApiOperation(value = "查询某个参保方案使用的月份")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "progId", dataType = "String", value = "参保方案表ID", paramType = "query")
    })
    Result<List<EmpSocInfoListVO>> selectTimeInfoByProgId(@Valid String progId);

    /**
     * 查询某个人的所有正常应缴,和补收社保过的时间
     *
     * @param empId     员工Id
     * @param companyId 公司Id
     * @return 的hi见列表
     */
    @ApiOperation(value = "批量撤销参保")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empId", dataType = "String", value = "员工Id", paramType = "query"),
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司Id", paramType = "query")
    })
    Result<List<Date>> selectEmpIsHaveFillCollectAndNormalDate(String empId, String companyId);

    /**
     * 小程序端个人查询社保详情
     *
     * @param pageNo   pageNo
     * @param pageSize pageSize
     * @return 个人社保详情
     */
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pageSize", dataType = "Integer", value = "pageSize", paramType = "query"),
            @ApiImplicitParam(name = "pageNo", dataType = "Integer", value = "pageNo", paramType = "query")
    })
    @ApiOperation(value = "小程序端个人查询社保详情")
    Result<Page<EmpSocSmallProgramVO>> userEmpSocInfoForMini(Integer pageSize, Integer pageNo);

    /**
     * 查询员工是否参保
     *
     * @param empId 员工Id
     * @return 是否参保
     */
    @ApiOperation(value = "查询员工是否参保")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empId", dataType = "String", value = "员工Id", paramType = "path")
    })
    Result<EmpSocInfoVO> findEmpHaveSocInfo(String empId);

    /**
     * 删除
     *
     * @param empSocInfoId 记录Id
     * @return 删除条目
     */
    @ApiOperation(value = "删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocInfoId", dataType = "String", value = "记录Id", paramType = "path")
    })
    Result<Integer> deleteById(String empSocInfoId);

    /**
     * 参保管理动态表头
     *
     * @param headerFieldsSocQuery 查询参数
     * @return 表头
     */
    @ApiOperation(value = "参保管理动态表头")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "headerFieldsSocQuery", dataType = "HeaderFieldsSocQuery", value = "查询参数", paramType = "query")
    })
    Result<HeaderFieldsVO> getDynamicHead(HeaderFieldsSocQuery headerFieldsSocQuery);
}

